package com.ipc.app.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/jsp/logout.do")
public class LogoutAction {

	@RequestMapping
	public void execute(ModelMap model, HttpServletRequest request,
			HttpServletResponse response) {
		request.getSession().invalidate();
		try {
			response.sendRedirect("../index.jsp");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
